// 导入所有模块
import { initUpload, getUploadedImages } from './modules/upload.js';
import { initPathGeneration } from './modules/path.js';
import { initTemplateSelection } from './modules/template.js';
import { initElevationChart } from './modules/chart.js';
import { initNav } from './utils/nav.js';
import { updateStepIndicator } from './utils/progress.js';

// 页面加载完成后初始化所有模块
document.addEventListener('DOMContentLoaded', () => {
    initUpload(); // 初始化图片上传
    initNav(); // 初始化底部导航
    initTemplateSelection(); // 初始化模板选择
    initPathGeneration(); // 初始化路径生成
    
    // 绑定结果页图表初始化（供path模块调用）
    window.initResultChart = () => {
        const waypointNum = getUploadedImages().length;
        document.getElementById('waypointCount').textContent = `${waypointNum}个`;
        document.getElementById('waypointStat').textContent = waypointNum;
        initElevationChart();
    };
});